package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.hq.ims.data.annotation.ChangeRecord;
import com.hq.ims.data.entityenum.*;
import com.hq.ims.data.vo.BusiInfoMapstruct;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author 蒋柏平
 * @since 20241025
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Alias("BusiInfo")
@TableName(value = "busi_info")
@ApiModel(value = "经营信息管理主表", description = "经营信息管理主表")
public class BusiInfo extends BaseModel<BusiInfo> implements Serializable {

    @ApiModelProperty(value = "经营信息管理ID")
    @TableId(value = "busi_info_id", type = IdType.ASSIGN_UUID)
    private String busiInfoId;

    @ApiModelProperty(value = "重复率")
    @TableField(value = "repetition_rate")
    private Double repetitionRate;

    @ApiModelProperty(value = "项目名称")
    @TableField(value = "project_name")
    private String projectName;

    @ApiModelProperty(value = "信息类型")
    @TableField(value = "info_type")
    private EnumBusinessTypeStatus infoType;

    @ApiModelProperty(value = "信息来源")
    @TableField(value = "info_source")
    private String infoSource;

    @ApiModelProperty(value = "项目地址名称")
    @TableField(value = "project_address_name")
    private String projectAddressName;

    @ApiModelProperty(value = "经度")
    @TableField(value = "longitude")
    private String longitude;

    @ApiModelProperty(value = "纬度")
    @TableField(value = "latitude")
    private String latitude;

    @ApiModelProperty(value = "信息类型")
    @TableField(value = "project_stage")
    private EnumProjectPhase projectStage;

    @ApiModelProperty(value = "省份")
    @TableField(value = "province")
    private String province;

    @ApiModelProperty(value = "省份编码")
    @TableField(value = "province_code")
    private String provinceCode;

    @ApiModelProperty(value = "城市")
    @TableField(value = "city")
    private String city;

    @ApiModelProperty(value = "市区编码")
    @TableField(value = "city_code")
    private String cityCode;

    @ApiModelProperty(value = "联系人")
    @TableField(value = "contact_person")
    private String contactPerson;

    @ApiModelProperty(value = "联系方式")
    @TableField(value = "contact_infomation")
    private String contactInfomation;

    @ApiModelProperty(value = "业主方公司名称")
    @TableField(value = "owner_company_name")
    private String ownerCompanyName;

    @ApiModelProperty(value = "施工方公司名称")
    @TableField(value = "construction_name")
    private String constructionName;

    @ApiModelProperty(value = "预计产值规模")
    @TableField(value = "output_scale")
    private BigDecimal outputScale;

    @ApiModelProperty(value = "项目备注")
    @TableField(value = "project_remark")
    private String projectRemark;

    @ApiModelProperty(value = "发布人")
    @TableField(value = "publisher")
    private String publisher;

    @ApiModelProperty(value = "发布人id")
    @TableField(value = "publisher_id")
    private String publisherId;

    @ApiModelProperty(value = "发布状态")
    @TableField(value = "publish_status")
    private EnumPublishStatus publishStatus;

    @ApiModelProperty(value = "发布时间")
    @TableField(value = "publish_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

    @ApiModelProperty(value = "审核状态")
    @TableField(value = "audit_status")
    private EnumAuditStatus auditStatus;

    @ApiModelProperty(value = "审核人")
    @TableField(value = "audit_user_id")
    private String auditUserId;

    @ApiModelProperty(value = "审批时间")
    @TableField(value = "audit_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime auditTime;

    @ApiModelProperty(value = "审核备注")
    @TableField(value = "audit_remark")
    private String auditRemark;

    @ApiModelProperty(value = "接受状态")
    @TableField(value = "accept_status")
    private EnumReceiveStatus acceptStatus;

    @ApiModelProperty(value = "组织机构ID")
    @TableField(value = "org_id", fill = FieldFill.INSERT)
    private String orgId;

    @ApiModelProperty(value = "组织机构名称")
    @TableField(value = "org_name", fill = FieldFill.INSERT)
    private String orgName;

    @ApiModelProperty(value = "父ID(顶经则为0)")
    @TableField(value = "parent_id")
    private String parentId;

    @ApiModelProperty(value = "根ID")
    @TableField(value = "root_id")
    private String rootId;

    @ApiModelProperty(value = "产业标记")
    @TableField(value = "industry_assign")
    private String industryAssign;

    @ApiModelProperty(value = "企业分成规则")
    @TableField(value = "company_divide_Into_rule_value")
    private BigDecimal companyDivideIntoRuleValue;

    @ApiModelProperty(value = "资金来源")
    @TableField(value = "funding_source")
    private String fundingSource;

    @ApiModelProperty(value = "招标获取截止时间")
    @TableField(value = "tender_closing_date")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime tenderClosingDate;

    @ApiModelProperty(value = "招标截止时间")
    @TableField(value = "deadline_for_bidding")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deadlineForBidding;

    @ApiModelProperty(value = "项目规模")
    @TableField(value = "project_scale")
    private String projectScale;

    @ApiModelProperty(value = "工期要求")
    @TableField(value = "duration_required")
    private String durationRequired;

    @ApiModelProperty(value = "招标范围")
    @TableField(value = "tender_scope")
    private String tenderScope;

    @ApiModelProperty(value = "资质要求")
    @TableField(value = "qualifications")
    private String qualifications;

    @ApiModelProperty(value = "招标控制价")
    @TableField(value = "tender_control_price")
    private BigDecimal tenderControlPrice;

    @ApiModelProperty(value = "保证金金额")
    @TableField(value = "bond")
    private BigDecimal bond;

    @ApiModelProperty(value = "保证金缴纳截止时间")
    @TableField(value = "bond_end_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime bondEndTime;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_date_time", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDateTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_date_time", fill = FieldFill.INSERT_UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDateTime;

    @ApiModelProperty(value = "是否删除")
    @TableField(value = "is_del")
    @TableLogic
    private Boolean isDel;

    @ApiModelProperty(value = "创建用户名称")
    @TableField(value = "create_user_name", fill = FieldFill.INSERT)
    private String createUserName;

    @ApiModelProperty(value = "更新用户名称")
    @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;

    @ApiModelProperty(value = "乐观锁")
    @TableField(value = "version")
    @Version
    private Integer version;

    public BusiInfoMapstruct.BusiInfoRowAuthVo auth() {
        BusiInfoMapstruct.BusiInfoRowAuthVo auth = new BusiInfoMapstruct.BusiInfoRowAuthVo(this);
        return auth;
    }

}
